| ![]() |
The following steps describe how to create HttpHandler and host your WebDAV server in IIS:
public class MyHttpHandler
: IHttpHandler
{
public void ProcessRequest(HttpContext
context)
{
context.Response.BufferOutput = false;
// always
create log file outside of the \bin folder if hosted in IIS\ASP.NET.
FileLogger.LogFile
= context.Request.PhysicalApplicationPath + "WebDAVlog.txt";
WDEngine
engine = new WDEngine();
engine.Run(HttpContext.Current);
}
}
Make sure your log file is created outside of the \bin folder. If your logfile will be created in a \bin folder, your server will restart each time the logfile is updated, recycling application and session state.In case of IIS 7.0 integrated mode:
<configuration>
<system.webServer>
<handlers>
<clear
/>
<add
name="My WebDAV Handler"
path="*" verb="*" type=" MyNamespace.MyHttpHandler,
MyDll" />
</handlers>
</system.webServer>
</configuration>
<configuration>
<system.web>
<httpHandlers>
<clear
/>
<add
verb="*" path="*" type="MyNamespace.MyHttpHandler, MyDll" />
</httpHandlers>
</system.web>
</configuration>
See Also: